Skip to main content

Running a Decision Strategy using a Data Flow

5 Tasks

30 mins

Visible to: All users
Beginner Pega Platform English

Scenario

As a System Architect, you are tasked with creating a Data Flow that runs the NextBestLabel Decision strategy. The strategy is provided in your system in the Sample-Data-Customer class. The strategy must store its results in a data set in the Strategy Results class.

Use the following credentials to log in to the exercise system:

Role User name Password
System Architect SystemArchitect rules

Your assignment consists of the following tasks:

Task 1: Create a Data Set in the SR class to output the strategy results

As a System Architect, create a new Decision Data Store type Data Set named NextBestLabelResults in the Strategy Results class to hold the results of the decision strategy.

Task 2: Create a Data Flow

Create a new Data Flow that runs the NextBestLabel strategy.

Task 3: Preview the records in the Data Flow

Preview data in the data set Customer component to validate that the strategy operation is successful.

Task 4: Run the Data Flow and observe the results

Run the Data Flow and confirm that the configuration is correct and that the decision strategy properly stores its results.

Task 5: Preview the strategy results in the output data set

Browse the output data set and review its contents. Use the Browse by keys function to view results for a specific customer.

 

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Challenge Walkthrough

Detailed Tasks

1 Create a Data Set in the SR class to output the strategy results

  1. On the exercise system landing page, click Launch Pega Infinity™ to log in to Dev Studio
  2. Log in as a System Architect:
    1. In the User name field, enter SystemArchitect.
    2. In the Password field, enter rules.
  3. In the navigation pane of Dev Studio, click App to open the Application Explorer.
  4. In the Application Explorer, search for the Academy-Sample-SR class.
  5. Right-click Academy-Sample-SR, then click Create > Data Model > Data Set.
    data set menu selection
  6. On the Create Data Set Rule form, create a new Data Set:
    1. In the Label field, enter NextBestLabel Results.
    2. In the Type list, select Decision Data Store.
    3. In the Add to ruleset field, verify that ExerciseArtifacts 01-01-01 is selected.
    4. Click Create and open to save the new Data Set configuration.
      create data set 0
  7. In the Keys section in the first field, enter .pySubjectID.
  8. Click Add key and in the new field, enter .pyLabel.
  9. In the upper-right corner, click Save to save the new Data Set configuration.
    click save 0
  10. In the upper-right corner, click Actions > Run.
    1. In the Run Data Set window, in the Operation field, select Browse.
    2. Click Run.
      Note: In the Data Set Preview window, notice that the Data Set contains no records at this point.
    3. Close the Data Set Preview window.
    4. Close the Run Data Set window.

2 Create a Data Flow

  1. In the Application Explorer, search for the Sample-Data-Customer class.
  2. Right-click Sample-Data-Customer, then click Create > Data Model > Data Flow.
  3. On the Create Data Flow Rule form, create a new Data Flow:
    1. In the Label field, enter Strategy Results.
    2. In the upper-right corner, click Create and open.
      create data flow 0
  4. On the Edit Data flow: Strategy Results Rule form, complete the following settings:
    1. On the canvas, double-click the first shape to set up the source configurations.
    2. In the Source list, select Data set.
    3. In the Data set field, enter or select Customer.
    4. Click Submit.
      source configurations
  5. On the canvas, on the first shape, click Add > Strategy to add a new strategy component.
    add strategy compoenent
  6. On the canvas, double-click the unconfigured (- -) component to set up the strategy configurations:
    1. In the Strategy field, enter or select NextBestLabel.
    2. Click Submit to save the strategy component configuration.
  7. On the canvas, double-click the last component to define the output destination for the Data Flow.
    1. In the Destination field, select Data Set.
    2. In the Data set field, select NextBestLabelResults.
    3. Click Submit to save the component configuration.
      destination configurations
  8. In the upper-right corner, click Save.

3 Preview the records in the Data Flow

  1. On the Data flow: Strategy Results Rule form, right-click the Customer Data Set, and then select Preview.
  2. In the Input Data Preview window, review the results:
  3. Click a few results and confirm that the customer data is available for the Age, CLV, and CustomerID properties.
    Note: By default, the preview window shows a maximum of 10 records.
  1. Close the Input Data Preview window.

4 Run the Data Flow and observe the results

  1. On the Data flow: Strategy Results Rule form, in the upper-right corner, click Actions > Run.
  2. In the New: Data Flow Work Item window, click Submit to approve the Data Flow run configuration.
  3. In the upper-right corner, click Start to run the Data Flow.
  4. When the Data Flow completes, on the Component statistics tab, notice the records processing information through the NextBestLabel Strategy.
    records processing results
  5. Close the Data Flow run tab to return to the Data Flow canvas.

5 Preview the strategy results in the output data set

  1. On the canvas, right-click the NextBestLabel Results component and select Open data set.
  2. On the Data Set: NextBestLabel Results Rule form, in the upper-right corner, click Actions > Run.
    1. In the Run Data Set window, in the Operation drop-down list, select Browse.
    2. In the Maximum number of records to read field, enter 1000.
    3. Click Run to view the Data Set.
    4. Notice that the Data Set contains Strategy results for all input records.
      data set final population
    5. Close the Data Set Preview window.
    6. In the Operation drop-down list, select Browse by keys.
    7. In the Key column, select pySubjectID
    8. In the Value field, enter Customer-, and then the customer number, ranging from 1 to 1000, and click Run.
      browse by keys
    9. In the Data Set Preview widow, notice that only one result for that specific customer is listed.


Available in the following mission:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice